#!/usr/bin/make -f



DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

config.status: configure
./configure --prefix=/usr\
            --host=$(DEB_HOST_GNU_TYPE)\
            --build=$(DEB_BUILD_GNU_TYPE)

#Some generic targets to check the build process
build: build-stamp

build-stamp:  config.status
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)

	touch build-stamp
#Now we install the packages all together to the tmp-dir inside of debian/

install: build
	dh_testdir
	dh_testroot
	dh_clean -a -k 
	dh_installdirs -a

	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

#And here is the well known clean target
clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp 

#Now the targets for dpkg-buildpackage
binary-indep: build install

tastymenu: install
	dh_testdir -ptastymenu; \
	dh_testroot -ptastymenu; \
	dh_installchangelogs docs/Changelog -ptastymenu; \
	dh_installdocs -ptastymenu; \
	dh_install -Xlicense.txt -ptastymenu; \
	dh_installmenu -ptastymenu; \
	dh_installdebconf -ptastymenu; \
	dh_installman -ptastymenu; \
	dh_link -ptastymenu; \
	dh_compress -X.pl -ptastymenu; \
	dh_perl -ptastymenu; \
	dh_makeshlibs; \
	dh_installdeb -ptastymenu; \
	dh_shlibdeps -ptastymenu; \
	dh_gencontrol -ptastymenu; \
	dh_md5sums -ptastymenu; \
	dh_fixperms -ptastymenu; \
	dh_builddeb -ptastymenu; \

binary-arch: tastymenu

binary: binary-indep binary-arch

